// Bad way of handling invalid method arguments
import  java.util.Scanner;
public class Circle{
    private static double area(double radius) {
        if(radius < 0){
           System.out.printf("Error: Negative radius%n");
               return -1;
         }
         else
            return  Math.PI *radius * radius;
     }

      public static void main(String[] args){
              Scanner scanner = new Scanner(System.in);
             double circleArea;
            do{
              System.out.printf("Enter  in cm radius >= 0: ");
              double radius = scanner.nextDouble();
              circleArea = area(radius);
           } while(circleArea == -1);
           System.out.printf("Circle area = %.2f sqr cm %n", circleArea);
       }
}
